/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.crm.store;

import java.sql.SQLException;
import java.util.List;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.Q400;
import queenb.web.util.PackageContants;

/**
 *
 * @author Thanh Luan
 */
public class K400Store extends Q400 {


    public int updateK400(int pnPK400, String pvKV401, String pvKV402,
            int pnFH000, int pnFH200,int PN100,  String pvLOGIN)throws SQLException, InstantiationException, IllegalAccessException {
  
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_K400, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPK400),
                        new Param(OracleTypes.CHAR, pvKV401),
                        new Param(OracleTypes.CHAR, pvKV402),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, PN100),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, Q400.class);

    }


    public int deleteK400(int pnPK400, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException{
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_K400, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPK400),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
       
            return super.update(dataStatement, Q400.class);

    }

    public int updateK450(int pnFK400, int pnFK100, String pvKV451,
            String pvKV452, String pvLOGIN)throws SQLException, InstantiationException, IllegalAccessException {

            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_K450, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFK400),
                        new Param(OracleTypes.INTEGER, pnFK100),
                        new Param(OracleTypes.CHAR, pvKV451),
                        new Param(OracleTypes.CHAR, pvKV452),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, Q400.class);

    }
    public int deleteK450(int pnPK400,int pnFK100, String pvKV451, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException{
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_K450, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPK400),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.CHAR, pvKV451),
                    new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.update(dataStatement, Q400.class);

    }
    public List<Q400> CombK400(
            int pnFH000,
            int pnFH200,
            int pnFK400,
            String pvLogin
            ) throws SQLException, InstantiationException, IllegalAccessException {
             DataStatement dataStatement = new DataStatement(PackageContants.COMBOBOX_K400, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK400),
                    new Param(OracleTypes.CHAR, pvLogin),
                });

            return super.find(dataStatement, Q400.class);

    }
    public List<Q400>COMBTABK400F(int pnFH000
                                  ,int pnFH200
                                  ,int pnFN100
                                  ,int pnFK400
                                  ,String pnKV402
                                  ,String pvLOGIN)throws SQLException, InstantiationException, IllegalAccessException {
             DataStatement dataStatement = new DataStatement(PackageContants.COMBOBOX_K400F, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFK400),
                    new Param(OracleTypes.CHAR, pnKV402),
                    new Param(OracleTypes.CHAR, pvLOGIN),
                });

            return super.find(dataStatement, Q400.class);

    }

}
